package algorithms;

import java.io.File;
import java.io.IOException;

/**
 * Lossless compression algorithms operating on any file format.
 * @author Johannes Mory
 *
 */
public interface LosslessCompressionAlgorithm 
{

	/**
	 * Compress file and write to file output stream. 
	 * The source file won't be changed.
	 * @param fileIn The uncompressed source file.
	 * @param fileOut The compressed source file.
	 */
	public void encode(File fileIn, File fileOut) throws IOException;
	
	/**
	 * Uncompress file and write to file output stream. 
	 * The source file won't be changed.
	 * @param fileIn The name of the compressed source file.
	 * @param fileOut The name of the uncompressed source file.
	 */
	public void decode(File fileIn, File fileOut) throws IOException;
	
	/**
	 * Return file extension of this algorithm.
	 * @return The file extension excluding the dot.
	 */
	public String getFileExtension();
	
	/**
	 * Set the file extension.
	 * @param name The new extension name.
	 */
	public void setFileExtension(String name);
	
}
